﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Popup.aspx.cs" Inherits="LinkCard.CustomerView.Popup" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script language="javascript" type="text/javascript" src="/Library/jquery.min.js"></script>
    <title></title>
    <style type="text/css">
        *
        {
            margin: 0;
            padding: 0;
        }
        body
        {
            font-family: Arial;
            font-size: 12px;
            background: transparent url(/template/Justin/images/bg-popup.gif) repeat-x top;
            color: #FFF;
        }
        #wrapper
        {
            width: 652px;
            height: 260px;
        }
        #header
        {
            width: 653px;
            height: 131px;
        }
        .logo
        {
            width: 358px;
            height: 131px;
            float: left;
            border-right: solid 1px #FFF;
            background: transparent url(/template/Justin/images/bgLinkCard.png) no-repeat bottom;
        }
        .desc
        {
            width: 238px;
            height: 76px;
            float: left;
            padding-left: 15px;
            padding-right: 40px;
            padding-top: 55px;
        }
        .btnRegister
        {
            width: 118px;
            height: 34px;
            background: transparent url(/template/Justin/images/btnRegister.png) no-repeat top;
            border: none;
            cursor: pointer;
            margin-left: 5px;
        }
        .body
        {
            width: 611px;
            float: left;
            margin-left: 24px;
            margin-top: 30px;
        }
        .body h2
        {
            float: left;
            width: 100%;
            font-size: 20px;
            text-transform: uppercase;
            font-weight: normal;
            margin-bottom: 5px;
        }
        .body input[type=text]
        {
            width: 473px;
            border: solid 1px #000;
            height: 35px;
            font-size: 20px;
            padding-left: 10px;
            color: #9e9e9e;
            float: left;
        }
    </style>
    <script language="javascript" type="text/javascript">
        function isValidEmailAddress(tar) {
            var emailAddress = document.getElementById("txtEmail").value;
            var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
            var result = pattern.test(emailAddress);
            if (result == true) {
                try {
                    __doPostBack('btnRegister', '');
                } catch (err)
                { }
            }

            return result;
        };

        function NoticeAndClose(result) {
            if (result == "1") {
                $("#notice").html("Bạn đã đăng ký nhận bản tin thành công!");
                setTimeout(function () {
                    parent.$.fancybox.close();
                }, 5000);
            } else if (result == "2") {
                $("#notice").html("Email này đã được đăng ký!");
            } else if (result == "0") {
                $("#notice").html("Đăng ký không thành công!");
            } else if (result == "-1") {
                $("#notice").html("Email không đúng định dạng.");
            }

        }
    </script>
</head>
<body>
    <form runat="server">
    <div id="wrapper">
        <div id="header">
            <div class="logo">
            </div>
            <div class="desc">
                <p>
                    Đăng kí ngay thông tin để nhận voucher mua sắm  trị giá 500,000 của chúng tôi khi đăng kí sử dụng thẻ Linkcard và nhiều cơ hội sở hữu quà tặng giá trị</p>
            </div>
        </div>
        <div class="body">
            <h2>
                Đăng ký nhận tin</h2>
            <input type="text" name="txtEmail" runat="server" onfocus="javascript:this.value='';"
                id="txtEmail" class="txtEmail" value="email của bạn" />
            <%--<asp:TextBox ID="txtEmail" CssClass="txtEmail" runat="server" Text="email của bạn"></asp:TextBox>--%>
            <asp:Button ID="btnRegister" OnClientClick="javascript:return isValidEmailAddress();"
                CssClass="btnRegister" runat="server" Text="" OnClick="btnRegister_Click" />
            <%--<input type="submit" class="btnRegister" value=""/>--%>
        </div>
        <div style="clear:both;"></div>
        <div id="notice" style="color: #FFFFFF;font-size: 16px;margin-left: 24px;margin-top: 5px;">
        </div>
    </div>
    </form>
</body>
</html>
